import request from '@/utils/request'

export function add(data) {
  delete data.id
  return request({
    url: '/userContract/edit',
    method: 'post',
    data
  })
}
export function delAll(data) {
  return request({
    url: 'api/database',
    method: 'post',
    data
  })
}

export function del(userId, storageId) {
  return request({
    url: `/userContract/delete?userId=${userId}&storageId=${storageId}`,
    method: 'get'
  })
}

export function userList() {
  return request({
    url: `/userContract/userList`,
    method: 'get'
  })
}

export function deleteCid() {
  return request({
    url: `/userContract/deleteCid`,
    method: 'get'
  })
}

export function edit(data) {
  return request({
    url: '/userContract/edit',
    method: 'post',
    data
  })
}

export default { delAll, edit, del, add, deleteCid }
